const Koa = require('koa');

const views = require('koa-views');

const path = require('path');

const app = new Koa();

// views(路径， 模板的配置参数)
app.use(views(path.join(__dirname, 'ejs'), {
  extension: 'ejs' // 扩展名
}))

app.use(async ctx => {
  await ctx.render('index', {
    title: 'index.ejs',
  })
}).listen(3030, () => {
  console.log('ejs');
})